package com.hoki.zj.hrm.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@ConfigurationProperties("oauth.client.properties")
@Component
@Data
public class OAuth2ClientDetailsProperties {

    private   OAuth2ClientDetails website;
    private   OAuth2ClientDetails admin;

    /**
     * 根据type获取OAuth2ClientDetails
     * @param type 类型
     * @return
     */
    public OAuth2ClientDetails getOAuth2ClientDetails(Integer type) {
        switch (type) {
            case 0:
                return this.admin;
            case 1:
                return this.website;
        }
        return null;
    }
}
